<ion-view title="添加拜访信息">
    <ion-nav-buttons side="right">
        <button class="button button-clear button-outline" ng-click="doSave()">
            保存
        </button>
    </ion-nav-buttons>
    <ion-content class="crm-content">
        <div class="list">
            <label class="item item-input item-select">
                <div class="input-label">
                    拜访方式
                </div>
                <select ng-options="key as value for (key,value) in dict['visit_way']"  ng-model="visit.visitWay">
                    <option value="">请选择</option>
                </select>
            </label>
            <label class="item item-input item-select">
                    <div class="input-label">
                    联系人
                </div>
                <select ng-options="item.id as item.name for item in hotelContacts"  ng-model="visit.hotelContacts">
                    <option value="">请选择</option>
                </select>
            </label>
            <label class="item item-input">
                <div class="input-label">
                    拜访日期
                </div>
                <input type="date" ng-model="visit.visitDate">
            </label>
            <label class="item item-input item-select">
                <div class="input-label">
                    拜访类型
                </div>
                <select ng-options="key as value for (key,value) in dict['visit_type']" ng-model="visit.visitType" ng-change="onVisitTypeChange(visit.visitType)">
                    <option value="">请选择</option>
                </select>
            </label>
        </div>
        <!--供应链业务-->
        <div class="list" ng-if="visit.visitType==11">
            <label class="item item-input item-select">
                <div class="input-label">
                    样品发放
                </div>
                <select ng-options="key as value for (key,value) in dict['sample_grant']" ng-model="visit.sampleGrant" >
                    <option value="">请选择</option>
                </select>
            </label>
            <div class="item item-input">
                <div class="input-label">
                    采购意向
                </div>
                <!--<select ng-options="key as value for (key,value) in dict['purchase_intention']" ng-model="visit.purchaseIntention" ng-change="clearVisitReasonList()">
                    <option value="">请选择</option>
                </select>-->
               <!--<label class="toggle toggle-dark" style="position: absolute;right: 12px;">
                    <input type="checkbox" checked ng-model="visit.purchaseIntentionCheckbox">
                    <div class="track">
                        <div class="handle"></div>
                    </div>
                </label>-->
                <label class="item item-checkbox">
                    <div class="checkbox checkbox-input-hidden disable-pointer-events checkbox-circle">
                        <input name="purchaseIntention" type="radio" ng-model="visit.purchaseIntention" value="T">
                        <i class="checkbox-icon"></i>
                    </div>
                    <div class="item-content disable-pointer-events">
                        <span>是</span>
                    </div>
                </label>
                <label class="item item-checkbox">
                    <div class="checkbox checkbox-input-hidden disable-pointer-events checkbox-circle">
                        <input name="purchaseIntention" type="radio" ng-model="visit.purchaseIntention" value="F">
                        <i class="checkbox-icon"></i>
                    </div>
                    <div class="item-content disable-pointer-events">
                        <span>否</span>
                    </div>
                </label>
            </div>
           <label class="item item-icon-right" ng-class="{'item-input':!reason['text']}" ng-click="showVisitReasonModalForm()">
                <div class="input-label">
                    采购商品情况
                </div>
                <!--<input type="text" placeholder="" ng-model="reason['text']" readonly>-->
               <p ng-show="reason['text']">
                   <i ng-repeat="(key,value) in dict['failure_reason']">
                       {{value+'采购情况：'+visit.reason[key]}}
                   </i>
               </p>
                <i class="icon ion-chevron-right icon-accessory"></i>
            </label>
        </div>
        <!--分销业务-->
        <div class="list" ng-if="visit.visitType==3">
            <div class="item item-input">
                <div class="input-label">
                    是否签约
                </div>
                <label class="item item-checkbox">
                    <div class="checkbox checkbox-input-hidden disable-pointer-events checkbox-circle">
                        <input name="isSign" type="radio" ng-model="visit.isSign" value="T">
                        <i class="checkbox-icon"></i>
                    </div>
                    <div class="item-content disable-pointer-events">
                        <span>是</span>
                    </div>
                </label>
                <label class="item item-checkbox">
                    <div class="checkbox checkbox-input-hidden disable-pointer-events checkbox-circle">
                        <input name="isSign" type="radio" ng-model="visit.isSign" value="F">
                        <i class="checkbox-icon"></i>
                    </div>
                    <div class="item-content disable-pointer-events">
                        <span>否</span>
                    </div>
                </label>
            </div>
        </div>
        <div class="list">
            <label class="item item-icon-right" ng-class="{'item-input':!visit.visitDesc}" ng-click="showVisitDescEditModalForm()">
                <div class="input-label">
                    拜访情况
                </div>
                <!--<input type="text" placeholder="" ng-model="visit.visitDesc" readonly>-->
                <p ng-show="visit.visitDesc">
                    {{visit.visitDesc}}
                </p>
                <i class="icon ion-chevron-right icon-accessory"></i>
            </label>

            <!--<label class="item item-input item-stacked-label crm-edit-label">-->
                <!--<textarea ng-model="visit.visitDesc" rows="4" placeholder="请输入拜访情况" readonly>-->
                <!--</textarea>-->
            <!--</label>-->
        </div>
  </ion-content>
</ion-view>
<style>
    .item-checkbox{
       position: absolute; top: 0px;border: 0px; padding-left: 45px;font-size:14px;
    }
    .item-checkbox{
        right:60px;
    }
    .item-checkbox:last-child{
         right:0px;
     }
    input[readonly]:not(.cloned-text-input){
        background-color: transparent;
        white-space: nowrap;
        text-overflow:ellipsis;
        padding-right: 50px;
    }
    .item-input input{
        text-align: right;
    }
    .item-checkbox,
    .item-input select,
    .item-input input{
        color: #aaa;
    }
    .item p {
        white-space: initial;
        color: #aaa;
        font-size: 14px;
    }
    .item p i:first-child{
        margin-top:5px;
    }
    .item p i{
        line-height: 20px;
        display: block;
    }
</style>